<template>
  <el-dialog
    title="患 者 信 息"
    :visible.sync="centerDialogVisible"
    :before-close="handleClose"
    center
  >
    <div class="alert-box">
      <div class="box-left">
        <div class="user-title">
          <span>姓名：{{ alertdata.name }}</span>
          <span>性别：{{ sexobj[alertdata.sex] }}</span>
          <span>年龄：{{ alertdata.age }}</span>
          <div class="state state1" v-show="alertdata.state == 1">
            {{ this.stateobj[alertdata.state] }}
          </div>
          <div class="state state2" v-show="alertdata.state == 2">
            {{ this.stateobj[alertdata.state] }}
          </div>
          <div class="state state3" v-show="alertdata.state == 3">
            {{ this.stateobj[alertdata.state] }}
          </div>
        </div>
        <p>手机号码：{{ alertdata.phone }}</p>
        <div>诊断时间：{{ alertdata.date }}</div>
        <p>主治医生：{{ alertdata.doctor }}</p>
        <div class="details">
          病例详情：
          <div class="details-p">
            &nbsp;&nbsp;&nbsp;&nbsp;<span>{{ caseobj[alertdata.case.a1] }}</span
            >&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;<span>{{
              caseobj[alertdata.case.a2]
            }}</span>
            &nbsp;&nbsp;&nbsp;&nbsp;<span>{{
              caseobj[alertdata.case.a3]
            }}</span>
            &nbsp;&nbsp;&nbsp;&nbsp;<span>{{
              caseobj[alertdata.case.a4]
            }}</span>
          </div>
        </div>
      </div>
      <div class="box-right">
        <img src="../../../imgs/切图/其他页/main-icon-touxiang-01.png" alt="" />
        <p>{{ alertdata.grade }}</p>
      </div>
    </div>
    <span slot="footer" class="dialog-footer">
      <el-button type="primary" @click="$parent.isshow = false"
        >确 定</el-button
      >
    </span>
  </el-dialog>
</template>

<script>
export default {
  props: ["alertdata"],
  data() {
    return {
      centerDialogVisible: true,
      // msg: {
      //   name: "李进",
      //   vip: "vip3",
      //   sex: "男",
      //   age: 25,
      //   data: "2019-11-12",
      //   section: "全科",
      //   doctor: "王阿",
      //   phone: 18811111111,
      //   state: "待接诊",
      // },
      caseobj: {
        1: "贫血",
        2: "感冒",
        3: "高血压",
        4: "心脏病",
        5: "牙痛",
        6: "发烧",
        7: "肚子痛",
        8: "冠心病",
        9: "心绞痛",
        10: "心户车失常",
        11: "高血脂",
        12: "妇科病",
        13: "脑血栓",
        14: "脑栓塞",
        15: "脑萎缩",
      },
      stateobj: {
        1: "待接诊",
        2: "接诊中",
        3: "已完成",
      },
      sexobj: {
        1: "男",
        2: "女",
      },
    };
  },

  mounted() {},

  methods: {
    // 叉号的关闭
    handleClose(done) {
      this.$parent.isshow = false;
    },
    // 确定的关闭
    closed() {
      this.$parent.isshow = false;
    },
  },
};
</script>

 <style lang="less" scoped>
.alert-box {
  width: 100%;
  height: 100%;
  display: flex;
  font-size: 16px;
  .box-left {
    width: 80%;
    height: 100%;
    box-sizing: border-box;
    padding-left: 30px;
    letter-spacing: 1px;
    line-height: 30px;
    .user-title span {
      margin-right: 50px;
    }
    .details {
      display: flex;
    }
  }
  .box-right {
    color: rgb(255, 234, 187);
    font-style: oblique;
    font-weight: bold;
    font-size: 18px;
    text-align: center;
    line-height: 40px;
  }
}

.state {
  display: inline-block;
  width: 80px;
  height: 25px;
  color: #fff;
  text-align: center;
  line-height: 25px;
  border-radius: 15px;
  vertical-align: top;
}
.state1 {
  background-color: #ff6262;
}
.state2 {
  background-color: #2bcd92;
}
.state3 {
  background-color: #cbcbcb;
}
</style>